import React from 'react';
import { inject, observer } from 'mobx-react';
import { WeaReqTop, WeaLocaleProvider } from 'ecCom';

const getLabel = WeaLocaleProvider.getLabel;

@inject('netDiskStore')
@observer
class Top extends React.Component {
   constructor(props) {
      super(props);
      this.state = {
         title: getLabel(514016, '我的云盘'),
         icon: <i className="icon-portal-CloudStore" style={{ display: 'block', marginTop: 8 }} />,
         iconBgcolor: '#f4b723',
         tabDatas: [
            {
               key: 'netDisk',
               title: getLabel(514015, '云盘'),
            },
            {
               key: 'share',
               title: getLabel(514017, '分享'),
            },
         ],
      };
   }

   changeSelect = (v) => {
      const { changeTopSelect } = this.props.netDiskStore;
      changeTopSelect(v);
   };


   render() {
      const { topSelectedKey } = this.props.netDiskStore;

      return (
         <WeaReqTop ecId={`${this && this.props && this.props.ecId || ''}_WeaReqTop@958mqg`}
           {...this.state}
           selectedKey={topSelectedKey}
           onChange={this.changeSelect}
         />
      );
   }
}

export default Top;

